<!DOCTYPE html>
<html>
    <head>
        <title>blog {% block title%}博客-静心之地{% endblock %}</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- 新 Bootstrap 核心 CSS 文件 -->
        <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
        <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
        <script type="text/javascript" src="/static/jquery-3.6.0.min.js"></script>
        <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
        <script type="text/javascript" src="/static/bootstrap/js/bootstrap.bundle.min.js"></script>
        <!-- ??? <script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>-->
        <script type="text/javascript" src="/static/contentstatic/ckeditor/ckeditor-init.js"></script>
        <script type="text/javascript" src="/static/contentstatic/ckeditor/ckeditor/ckeditor.js"></script>
        <style type="text/css">
          {% block css%}{% endblock %}
        </style>
    </head>
    <body style="background-color:#E4E4E4;">
<div id="top-header">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary" style="background-color:">
  <div class="container-fluid">
    <a class="navbar-brand" href="#">静心之地</a>
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav me-auto mb-2 mb-lg-0">
        <li class="nav-item">
          <a class="nav-link active" aria-current="page" href="/blog">Home</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" target="_blank" href="/">翻译</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" target="_blank" href="/knowledge/">知道</a>
        </li>
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
            Blog
          </a>
          <ul class="dropdown-menu">
            <li><a class="dropdown-item" href="#">设置</a></li>
            <li><hr class="dropdown-divider"></li>
            <li><a class="dropdown-item" href="/blog/userLogout">退出登录</a></li>
          </ul>
        </li>
        <!--<li class="nav-item">
          <a class="nav-link disabled">Disabled</a>
        </li>-->
      </ul>
      <form class="d-flex" role="search">
        {% if username %}
          <a class="navbar-brand" href="/blog/personal/">{{ username }}</a>
        {% else %}
          <a href="/blog/publish/" class="btn btn-outline-message me-2" target="_blank">Login</a>
        {% endif %}
        <a href="/blog/publish/" class="btn btn-outline-message me-2" target="_blank">+</a>
        <input class="form-control me-1" type="search" placeholder="Search" aria-label="Search">
        <button class="btn btn-dark" type="submit">Search</button>
      </form>
    </div>
  </div>
</nav>
<nav id="myTab1" class="nav nav-tabs navbar-light bg-light" role="tablist">
{% block subnav %}{% endblock %}
</nav>
</div>
        {% block body%}{% endblock %}
<div id="footer">
<!-- <nav class="navbar sticky-bottom bg-light">
  <div class="container-fluid">
    <a class="navbar-brand" href="#">sticky-bottom</a>
  </div>
</nav> 
<nav class="navbar fixed-bottom bg-light">
  <div class="container-fluid">
    <a class="navbar-brand" href="#">Fixed bottom</a>
  </div>
</nav>-->
</div>
<!-- 自定义的模态窗口 ajax调用后台执行时展现 begin-->
<div id="loading" style="text-align:center;background-color:rgba(0,0,0,0.7);display:none; position:fixed;width:100%;height:100%;z-index:199;box-sizing: border-box;top:0;left:0;">
    <div class="card" style="width:50%;display:inline-block;top:30%">
        <div class="card-header">
          <h5>提示：</h5>
        </div>
        <div class="card-body">
          <p class="card-text">程序正在运行，请耐心等待......</p>
        </div>
    </div>
</div>
<!-- 自定义的模态窗口 ajax调用后台执行时展现 end-->
<!-- bootstrap的模态窗口 begin-->
<div class="modal" tabindex="-1" id="alertmodal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">提示：</h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body" id="alertmodalbody">
        <p>Modal body text goes here.</p>
      </div>
      <!--<div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">确定</button>
      </div>-->
    </div>
  </div>
</div>
<!--使用示例
   const myModalAlternative = new bootstrap.Modal('#alertmodal');
   const myModalEl = document.getElementById('alertmodal');
    /**
     * 校验url
     */
    function validationUrl(){
        _url = $("#urlsearch").val();
        if(_url==""){
            myModalEl.addEventListener('shown.bs.modal', event => {
                $("#alertmodalbody").html("<p>请输入url</p>");
            });
            myModalAlternative.show();
            return false;
        }
        if(!isUrl(_url)){
            myModalEl.addEventListener('shown.bs.modal', event => {
                $("#alertmodalbody").html("<p>url格式错误，请重新输入</p>");
            });
            myModalAlternative.show();
            return false;
        }
        return true;
    }
    -->
<!-- bootstrap的模态窗口 end  -->
<script type="text/javascript">
   const myModalAlternative = new bootstrap.Modal('#alertmodal');
   const myModalEl = document.getElementById('alertmodal');
{% block javascript %}{% endblock %}
</script>
    </body>
</html>
